#pragma once
#include <stdio.h>
//#include "SDL_ttf.h"
#include "sdl\include\SDL_ttf.h"
#include "global.h"
#include "Player.h"

/*--- Game States ---*/
#define NO_ACTION     0
#define GAME_START    1
#define GAME_END      2
#define ROUND_START   3
#define ROUND_END     4
#define SCORING       5
#define PLAYER_TURN   6
#define CHANGE_PLAYER 7

struct UserInterface
{
	// where is it going to be located
	Position menuPos;
	// the drawing areas
	SDL_Rect rect;
	// surface dimensions
	int height, width;
};

// Rules and scoring guides for the game
class GameData
{
public:
	/*--- De/Constructors ---*/
	GameData(SDL_Surface *a_buffer);
	~GameData();
	/*--- Basic Game Functions ---*/
	// draws to the screen
	void draw();
	// update game logic and information
	void update();
	// handles the input
	void handleInput();
	// cleanup method
	void Release();

	/*--- Main Game Functions ---*/
	// checks if program is still runnning
	bool isRunning() { return running; }

private:
	SDL_Surface * buffer;
	SDL_Surface * uiElement;
	SDL_Surface * gRoundText;
	// player turn
	SDL_Surface * pTurnText;
	// next player
	SDL_Surface * nTurnText;
	SDL_Color uiTextColor;
	TTF_Font * font;
	UserInterface * uiMenu1;
	Player * players;
	Position mPos;

	// current Player
	int currentPlayer;
	// current player turn
	int turnRound;
	// current turn of the round
	int  gameRound;
	bool running;
	bool noFreeDice;
	bool noRoll;

	// current functions active
	int gameState;

	/*--- Sub-Functions ---*/
	void mouseButtonClicked();
	// has player exceeded maximum rolls allowed?
	bool canRoll() { return noRoll; }
	// clears screen for redrawing
	void Clear();
	// loads our true type font
	TTF_Font* loadFont(char* file, int size);
};